#!/bin/bash
set -eo pipefail

#Directory that the script is in no matter where you invoke it from
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

"$DIR/gradlew" :resetXrepo --no-daemon -DSKIP_BUILD_SCAN=true 1>&2

stdout=$(git status --porcelain)
if [[ -n $stdout ]]
then
  printf "\n\nError: you can't make changes to files fetched via xrepo!\n"
  echo "Output of 'git status':"
  echo "$stdout"
  exit 1
fi
add 6 line
